package ru.usu.gv.gui.frames.styles;

import ru.usu.gv.gui.frames.EditEdgePanelBase;
import ru.usu.gv.gui.frames.ISaveCallback;
import ru.usu.gv.styles.Style;
import ru.usu.gv.styles.StyleFacade;

import java.util.List;

/**
 * @author spupyrev
 * 02.11.2008
 */
public class EdgeStylePanel extends EditEdgePanelBase
{
	private Style style;

	public EdgeStylePanel(Style style, List<ISaveCallback> saveCallbacks)
	{
		super(saveCallbacks);
		this.style = style;
		initializeComponent();
	}

	@Override
	protected String getEdgeColor()
	{
		return style.getStringAttribute(StyleFacade.EDGE_COLOR_ATTRIBUTE);
	}

	@Override
	protected void setEdgeColor(String encodedColor)
	{
		style.setStringAttribute(StyleFacade.EDGE_COLOR_ATTRIBUTE, encodedColor);
	}

	@Override
	protected String getEdgeTypeId()
	{
		return style.getStringAttribute(StyleFacade.EDGE_TYPE_ATTRIBUTE);
	}

	@Override
	protected void setEdgeTypeId(String newEdgeTypeId)
	{
		style.setStringAttribute(StyleFacade.EDGE_TYPE_ATTRIBUTE, newEdgeTypeId);
	}

}
